<!DOCTYPE html>
<html>
<head>
    <include file="./public/sty.html"/>
    <style>

        .yz3, .yz4 {
            text-align: left !important;
            margin-left: 20px;
        }

        .yz3 :before, .yz4 :before {
            font-family: iconfont;
            font-style: inherit;
            padding: 0 5px;
            font-size: 14px;
            content: "\E60D";
        }
    </style>
</head>
<body>
<div id="app" class="verifyPwd">
    <include file="./public/header.html"/>

    <div class="container notSign fix pt15" s="[object Object]">
        <div class="userRight">
            <div class="userMain mgb10">
                <ul class="queue">
                    <li class="right"><span>验证安全密码</span><i></i></li>
                    <li class="now"><span>设置密码</span><i></i></li>
                    <li><span>完成</span><i></i></li>
                </ul>
                <form action="{:U('Users/verifyPwd2')}" method="post" id="form">
                    <input type="hidden" name="id" id="uid" value="{$id}">
                    <ul class="submitContent mglr30 mgt15">
                        <li><span>新登录密码：</span>
                            <input regmsg="密码应为6-16位字符" tag="登录密码" id="pass1" type="password" autocomplete="off"
                                   class="userInput"><span class="yz3" style="width: 300px"></span>
                        </li>
                        <li>
                            <span>确认新密码：</span>
                            <input regmsg="确认密码应为6-16位字符" id="pass2" type="password" autocomplete="off"
                                   class="userInput _no_paste"><span class="yz4" style="width: 300px"></span>
                        </li>
                        <li>
                            <span></span>
                            <a class="submitBtn" style="margin-left: 60px" onclick="sav()">确定</a></li>
                    </ul>
                </form>
            </div>
        </div>
    </div>

    <include file="./public/footer.html"/>
</div>


<script src="/style/js/jquery.min.js"></script>
<script src="/style/js/fx.js"></script>
<script>
    $(function () {
        personalInfo();
    })
    function sav() {
        var id = $("#uid").val();
        var pass1 = $("#pass1").val();
        var pass2 = $("#pass2").val();
        if (pass1 == '') {
            $(".yz3").html("<font color='red'>密码不能为空</font>");
            return false;
        } else {
            $(".yz3").html("");
        }
        if (pass1.length < 6 || pass1.length > 20) {
            $(".yz3").html("<font color='red'>密码必须是6~20位</font>");
            return false;
        } else {
            $(".yz3").html("");
        }
        if (pass2 == '') {
            $(".yz4").html("<font color='red'>确认密码不能为空</font>");
            return false;
        } else {
            $(".yz4").html("");
        }
        if (pass1 != pass2) {
            $(".yz4").html("<font color='red'>两次输入的密码不一致</font>");
            return false;
        } else {
            $(".yz4").html("");
        }
        $.ajax({
            type: "POST",
            url: "{:U('Index/verifyPwd2')}",
            data: {'pass': pass1, 'id': id},
            success: function (dat) {
                if (dat == 1) {
                    window.location.href = "/Index/login/";
                }
            }
        });

    }
</script>
</body>
</html>